const Router = require('@koa/router');

const fs = require('node:fs');

const path = require('path');

const router = new Router();

const mds = fs.readdirSync(path.join(__dirname, '../modules'));

mds.forEach((file) =>
  router.use(require(`../modules/${file}/${file}.route.js`).routes())
);

module.exports = router;
